<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>
<?=$page_title?>
</title>
<base href="<?=base_url()?>" />
<link href="css/clientpublic.css" rel="stylesheet" type="text/css">
<link href="css/esui.css" rel="stylesheet" type="text/css">
<link href="css/initaccount.css" rel="stylesheet" type="text/css">
<link href="css/guo.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript"
	src="js/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<script type="text/javascript"
	src="js/fancybox/jquery.easing-1.3.pack.js"></script>
<script type="text/javascript"
	src="js/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
<link rel="stylesheet" type="text/css"
	href="js/fancybox/jquery.fancybox-1.3.4.css" />
<link rel="stylesheet" type="text/css" href="css/jia.css" />
<script type="text/javascript">
	$(document).ready(function() {
		jQuery.ajaxSetup ({cache:false}); /*让ajax不调用浏览的缓存*/
		$(".various1").fancybox({
		'titleShow'     : false,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'easingIn'      : 'easeOutBack',
		'hideOnOverlayClick' : false,
		'easingOut'     : 'easeInBack'});

		$("#MainBody div .g_title_sub").click(function(){
            var suppliers=$.trim($("#suppliers_name").val());
            if(suppliers == "" || suppliers == "供应商名称"){
              alert("请输入客户名称后查询");
              $("#suppliers_name").focus();
            }else{
				location.href="<?=base_url()?>index.php/suppliers/check/"+suppliers+"";
              }
		});

		$("#check_suppliers_info").change(function(){
			var type_id = $("#check_suppliers_info").val();
			location.href="<?= base_url()?>index.php/suppliers/check_type_suppliers/"+type_id+"";
		});

		$("table").delegate('tr',"hover", function(){
			$(this).toggleClass("hover");
		});
	});
</script>
</head>
<body>
	<div id="Holder">
		<div id="MainPage">
			<?php include('top.php')?>
			<div id="Subnav">
				<ul>
					<li class="active show"></li>
				</ul>
			</div>
			<!---------中间部分------------->
			<div id="MainBody">
				<div class="g_title">
					<div class="g_earch">
						 <input type="text" class="g_title_text"
							value="供应商名称" onClick="this.value=''" id="suppliers_name"><input type="button"
							value=" " class="g_title_sub">
					</div>
                    <div class="g_select">
					<select id="check_suppliers_info">
                    	<option value="0">请选择类别</option>
                    	<option value="1" >设备</option>
                    	<option value="2" >开发</option>
                    	<option value="3" >服务</option>
                    	<option value="4" >其他</option>
                    </select>
                    </div>
					<div class="add_customer">
						<div class="add_customer_bg10"><?=anchor('suppliers/show_suppliers_add/',' ','class="various1"','id="find"') ?></div>
					</div>
					
				</div>
				<table id="ContentTable" class="data-box">
					<thead>
						<tr class="border-in">
							<th><div>ID</div></th>
							<th><div>类别</div></th>
							<th><div>供应商</div></th>
							<th><div>联系人</div></th>
							<th><div>联系方式</div></th>
							<th><div>区域</div></th>
							<th><div>操作</div></th>
						</tr>
					</thead>
					<tbody>
						<?php foreach ($suppliers as $suppliers_item): ?>
                        <tr class="data-box-row">
                                <td><?=$suppliers_item->suppliers_id ?></td>
                                <td><?=$suppliers_item->type ?></td>
                                <td><?=$suppliers_item->name ?></td>
                                <td><?=$suppliers_item->contacter_one ?></td>
                                <td><?=$suppliers_item->tel_1 ?></td>
                                <td><?=$suppliers_item->district ?></td>
                                <td><a href="<?=base_url()?>index.php/suppliers/find/<?=$suppliers_item->suppliers_id ?>"
                                    class="various1 g_see" id="find" title="">查看</a>&nbsp;&nbsp; <a
                                    href="<?=base_url()?>index.php/suppliers/update/<?=$suppliers_item->suppliers_id ?>"
                                    class="various1 g_edit" id="find" title="">编辑</a>&nbsp;&nbsp; <span class="g_dele"
                                    id="delete<?=$suppliers_item->suppliers_id ?>">删除</span> <input type="hidden"
                                    id="suppliers_id<?=$suppliers_item->suppliers_id ?>" value="<?=$suppliers_item->suppliers_id ?>" />
                                    <script type="text/javascript">
                                         $(function(){
                                             $("#delete<?=$suppliers_item->suppliers_id ?>").click(function(){
                                                if (window.confirm("您确定要删除吗？")) {
                                                    var id=$("#suppliers_id<?=$suppliers_item->suppliers_id ?>").val();
                                                    location.href="<?=base_url()?>index.php/suppliers/delete/"+id+"";
                                                } else {
                                                }
                                            })
                                         })
                                    </script></td>
                            </tr>
                      <?php endforeach; ?>
                    </tbody>
				</table>
				<div id="PageControl">
					<div class="page-control">
						<div class="border-in">
							<span class="perpage"> <span class="perpage-text">
							<?php
							 if($pag_links){?>
							 	<?echo ($offset) ? ($offset+1):1;?> - <?=$current_total?> 条（共<?=$total?>条）
							 <?php }
							?>
							</span>
							</span>
							<p>
								<?=$pag_links?>
							</p>
						</div>
					</div>
				</div>

			</div>
			<!---------结尾------------->
			<?php include('footer.php')?>
		</div>
	</div>
</body>
</html>